home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 August / Australian PC User - August 2003 (CD2).iso / software / online / files / netsnip.exe / %MAINDIR% / Templates / Search / Default.xsl
Encoding:
Extensible Markup Language  |  2003-06-02  |  6.6 KB  |  242 lines

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  3.  
  4.   <xsl:template match="/">
  5.  
  6.     <HTML>
  7.       <BODY>
  8.             
  9.     <table border="0" width="100%" bgcolor="#FFFFFF" cellspacing="1" cellpadding="2">
  10.       <tr><td>
  11.  
  12.  
  13.            <table border="0" width="100%" bgcolor="#FFFFFF" cellspacing="0" cellpadding="2">
  14.  
  15.              <tr>    
  16.              <td width="4%" align="middle">
  17.  
  18.            <IMG>
  19.              <xsl:attribute name="src"><xsl:value-of select="SearchResults/ImageFolder"/>/search.gif</xsl:attribute>
  20.  
  21.              <xsl:attribute name="align">absmiddle</xsl:attribute>
  22.            </IMG>
  23.   
  24.              </td> 
  25.  
  26.            <td width="96%">
  27.  
  28.            <b><font face="Verdana" size="4">
  29.              <xsl:value-of select="SearchResults/Title"/>
  30.            </font></b></td>
  31.  
  32.            </tr>    
  33.        </table>
  34.  
  35.       </td></tr>
  36.  
  37.           <xsl:apply-templates select="SearchResults/SnippetDetails"/>
  38.  
  39.   <tr>
  40.     <td width="100%" bgcolor="#FFFFFF"><font face="Verdana" size="1">Search Results Generated 
  41. by <a href="http://www.netsnippets.com">Net Snippets</a><sup>TM</sup></font></td>
  42.   </tr>
  43.  
  44.     </table>
  45.  
  46.       </BODY>
  47.     </HTML>
  48.  
  49.   </xsl:template>
  50.  
  51.   <xsl:template match="SnippetDetails">
  52.          <tr><td>     
  53.              <TABLE BORDER="0" width="100%" cellpadding="2" cellspacing="0" bgcolor="#EEEEEE" style="border-style: solid; border-color: #C0C0C0; border-width: 1">
  54.  
  55.           <tr>
  56.               <td width="100%" colspan="2" bgcolor="#E0E0E0">
  57.  
  58.                 <IMG>
  59.                   <xsl:attribute name="src"><xsl:value-of select="/SearchResults/ImageFolder"/>/snippet.gif</xsl:attribute>
  60.                   <xsl:attribute name="align">absmiddle</xsl:attribute>
  61.                 </IMG>
  62.                   
  63.                  
  64.  
  65.                   <A>
  66.                     <xsl:attribute name="HREF"><xsl:value-of select="Path"/></xsl:attribute>
  67.                    <font size="2" face="Verdana">
  68.  
  69.   
  70.             <xsl:choose>
  71.                 <xsl:when test="Name/@found">
  72.             
  73.                       <xsl:value-of select="Name/BeforeMatch"/><b><xsl:value-of select="Name/Match"/></b><xsl:value-of select="Name/AfterMatch"/>
  74.                             
  75.         </xsl:when> 
  76.             <xsl:otherwise>
  77.             <xsl:value-of select="Name"/>
  78.  
  79.                 </xsl:otherwise>
  80.         </xsl:choose>
  81.  
  82.                    </font> 
  83.                   </A>
  84.                 
  85.         
  86.                 </td>
  87.  
  88.               </tr>
  89.  
  90.                <tr>
  91.                 <TD width="10%"><font size="2" face="Verdana">Importance:</font></TD>
  92.                 <TD><font size="2" face="Verdana"><xsl:value-of select="Importance"/></font></TD>
  93.                </tr>
  94.  
  95.                <tr>
  96.                  <TD width="10%"><font size="2" face="Verdana">Created:</font></TD>
  97.                  <TD><font size="2" face="Verdana"><xsl:value-of select="Date"/><xsl:value-of select="Time"/></font></TD>
  98.                </tr>
  99.  
  100.            <xsl:if test="Comments">
  101.                  <tr>
  102.                    <TD width="10%" valign="top"><font size="2" face="Verdana">Comments:</font></TD>
  103.  
  104.                    <TD><font size="2" face="Verdana">
  105.  
  106.             <xsl:choose>
  107.                 <xsl:when test="Comments/@found">
  108.                     <xsl:value-of select="Comments/BeforeMatch"/><b><xsl:value-of select="Comments/Match"/></b><xsl:value-of select="Comments/AfterMatch"/>
  109.                             
  110.         </xsl:when> 
  111.             <xsl:otherwise>
  112.             <xsl:value-of select="Comments"/>
  113.  
  114.                 </xsl:otherwise>
  115.         </xsl:choose>
  116.          </font></TD>
  117.                  </tr>
  118.            </xsl:if>
  119.     
  120.            <xsl:if test="Keywords">
  121.  
  122.                <tr>
  123.                 <TD width="10%"><font size="2" face="Verdana">Keywords:</font></TD>
  124.  
  125.                 <TD>
  126.                 <font size="2" face="Verdana">
  127.             <xsl:choose>
  128.                 <xsl:when test="Keywords/@found">
  129.             
  130.                       <xsl:value-of select="Keywords/BeforeMatch"/><b><xsl:value-of select="Keywords/Match"/></b><xsl:value-of select="Keywords/AfterMatch"/>
  131.                             
  132.         </xsl:when> 
  133.             <xsl:otherwise>
  134.             <xsl:value-of select="Keywords"/>
  135.  
  136.                 </xsl:otherwise>
  137.         </xsl:choose>
  138.  
  139.                 </font>
  140.         </TD>
  141.  
  142.                </tr>
  143.  
  144.            </xsl:if>
  145.  
  146.                <xsl:apply-templates select="CFields/CField"/>
  147.                <xsl:apply-templates select="Biblio"/>
  148.  
  149.               </TABLE> 
  150.  
  151.          </td></tr>    
  152.  
  153.   </xsl:template>
  154.  
  155.   <xsl:template match="Biblio">
  156.      <xsl:apply-templates select="Field"/>
  157.  
  158.   </xsl:template>
  159.  
  160.   <xsl:template match="Field">
  161.  
  162.          <tr>
  163.            <TD width="10%">
  164.            
  165.            <font size="2" face="Verdana"><xsl:value-of select="Name"/>:</font></TD>
  166.            <TD><font size="2" face="Verdana">
  167.  
  168.  
  169.         <xsl:choose>
  170.         <xsl:when test="IsURL">
  171.  
  172.  
  173.            <A>
  174.               <xsl:attribute name="HREF"><xsl:value-of select="Value"/></xsl:attribute>
  175.  
  176.             <xsl:choose>
  177.                 <xsl:when test="./@found">
  178.                   <xsl:value-of select="./BeforeMatch"/><b><xsl:value-of select="./Match"/></b><xsl:value-of select="./AfterMatch"/>
  179.                             
  180.         </xsl:when> 
  181.             <xsl:otherwise>
  182.                       <xsl:value-of select="Value"/>  
  183.  
  184.                 </xsl:otherwise>
  185.         </xsl:choose>
  186.            </A>
  187.  
  188.  
  189.     </xsl:when> 
  190.                 
  191.         <xsl:otherwise>
  192.  
  193.             <xsl:choose>
  194.                 <xsl:when test="./@found">
  195.             
  196.                   <xsl:value-of select="./BeforeMatch"/><b><xsl:value-of select="./Match"/></b><xsl:value-of select="./AfterMatch"/>
  197.                             
  198.         </xsl:when> 
  199.             <xsl:otherwise>
  200.                    <xsl:value-of select="Value"/>  
  201.  
  202.                 </xsl:otherwise>
  203.         </xsl:choose>
  204.  
  205.  
  206.         </xsl:otherwise>
  207.         
  208.         </xsl:choose>
  209.  
  210.            </font></TD>
  211.          </tr>
  212.  
  213.  
  214.   </xsl:template>
  215.  
  216.   <xsl:template match="CField">
  217.  
  218.          <tr>
  219.            <TD width="10%">
  220.            
  221.            <font size="2" face="Verdana"><xsl:value-of select="Name"/>:</font></TD>
  222.            <TD><font size="2" face="Verdana">
  223.  
  224.             <xsl:choose>
  225.                 <xsl:when test="./@found">
  226.             
  227.                   <xsl:value-of select="./BeforeMatch"/><b><xsl:value-of select="./Match"/></b><xsl:value-of select="./AfterMatch"/>
  228.                             
  229.         </xsl:when> 
  230.             <xsl:otherwise>
  231.                    <xsl:value-of select="Value"/>  
  232.  
  233.                 </xsl:otherwise>
  234.         </xsl:choose>
  235.  
  236.            </font></TD>
  237.          </tr>
  238.  
  239.  
  240.   </xsl:template>
  241.  
  242. </xsl:stylesheet>